/*
Swiper effect
*/
var $featured_slides;
var $blogger_block;

$(document).ready(function() {

//	var page_width 	= $(window).width();
//	var page_height = $(window).height();
//	var is_mobile 	= (page_width < 480 && page_width < page_height) || (page_width < 640 && page_width > page_height); 
	
	
	$featured_slides = jQuery(".swiper.featured-slides .swiper-container").swiper({
        watchActiveIndex: true,
        slidesPerView: 1,
        visibilityFullFit: true,
        calculateHeight: true,
//        centeredSlides: true,
        autoplay: 6000,
        resizeReInit: true,
        pagination: '.swiper-pagination',
        onSwiperCreated: function(swiper) {

            // Add Next & Prev button
            
            var $swiper = jQuery('.swiper.featured-slides');
            if ($swiper.find(".swiper-slide").length > 1) {
                $swiper.find(".slide-button.next").click(function() {
                    swiper.swipeNext();
                });
                $swiper.find(".slide-button.prev").click(function() {
                    swiper.swipePrev();
                });
            }else{
//                 $swiper.find(".swiper-control").remove();
            }
        }
	});
	$blogger_block = jQuery(".swiper.blogger-block .swiper-container").swiper({
        watchActiveIndex: true,
        slidesPerView: 1,
        visibilityFullFit: true,
        calculateHeight: true,
//        centeredSlides: true,
        autoplay: 6000,
        resizeReInit: true,
        pagination: '.swiper-pagination',
        onSwiperCreated: function(swiper) {

            // Add Next & Prev button
            
            var $swiper = jQuery('.swiper.blogger-block');
            if ($swiper.find(".swiper-slide").length > 1) {
                $swiper.find(".slide-button.next").click(function() {
                    swiper.swipeNext();
                });
                $swiper.find(".slide-button.prev").click(function() {
                    swiper.swipePrev();
                });
            }else{
//                 $swiper.find(".swiper-control").remove();
            }
        }
	});
	
	
    // if ($(".swiper.meet-our-team .views-row").length < 6) {
        
    //     meet_our_team = $(".swiper.meet-our-team .swiper-container").swiper({
    //         watchActiveIndex: true,
    //         slidesPerView: "auto",
    //         visibilityFullFit: true,
    //         calculateHeight: true,
    // //        centeredSlides: true,
    //         resizeReInit: true,
    // //        loop: true,
    // //        loopAdditionalSlides: 5,
    // //        loopedSlides: 3,
    //         onSwiperCreated: function(swiper) {

    //         }
    //     });
    // } else {
        
    //     meet_our_team = $(".swiper.meet-our-team .swiper-container").swiper({
    //         watchActiveIndex: true,
    //         slidesPerView: 'auto',
    //         visibilityFullFit: true,
    //         calculateHeight: true,
    //         centeredSlides: true,
    //         resizeReInit: true,
    //         loop: true,
    // //        loopAdditionalSlides: 5,
    //         loopedSlides: 5,
    //         onSwiperCreated: function(swiper) {

    //         }
    //     });
    // }
	
	
});
$( window ).resize(function() {
    if ($featured_slides.wrapper) {
        $featured_slides.reInit();
    }
});